$(function(){
	//菜单
	(function(){
		var menuLi = $("#menu .menu_right>ul>li");
		var menuA = $("#menu .menu_right>ul>li>a");
		var menuA1 = $("#menu .menu_right>ul>li:nth-child(1)>a");
		var menuA2 = $("#menu .menu_right>ul>li:nth-child(2)>a");
		var menuMain = $("#menu .menu_right>ul>li .menuMain");
		var menuMain1 = $("#menu .menu_right>ul>li:nth-child(1) .menuMain");
		var menuMain2 = $("#menu .menu_right>ul>li:nth-child(2) .menuMain");
		menuLi.hover(function(){
			$(this).find(".menuMain").show();
			
		},function(){
			$(this).find(".menuMain").hide();
		});
		menuA.hover(function(){
			$(this).css("background-color","#558B14");
		},function(){
			$(this).css("background-color","#373737");
		});
		menuMain1.hover(function(){
			menuA1.css("background-color","#E7E7E7");
		},function(){
			menuA1.css("background-color","#373737");
		});
		menuMain2.hover(function(){
			menuA2.css("background-color","#E7E7E7");
		},function(){
			menuA2.css("background-color","#373737");
		});
	})();
	
	//一路上有你
	(function(){
		var twentyYearDiv = $("#twentyYear>ul>li>a");
		twentyYearDiv.hover(function(){
			$(this).find(".twentyYear_box").hide();
		},function(){
			$(this).find(".twentyYear_box").show();
		});
	})();
	
	//底部
	(function(){
		var bottomMid_content = $("#bottom .bottomMid .bottomMid_content");//获取中间按钮
		var bottomMid_Main = $(".bottomMid_main");//中间部分展示区域
		
		var connectMain = $("#bottom .bottomLeft .connectMain");//联系展示部分
		var connect = $("#bottom .bottomLeft");
		
		var countryClick = $("#bottom .bottomRight");
		var countryMain = $("#bottom .bottomRight .bottomRight_Main");
		var deleteCountry = $("#bottom .bottomRight .bottomRight_Main .country .delete");
		
		//中间部分
		var mid1 = 0;
		bottomMid_content.click(function(){
			mid1++;
			if(mid1%2 == 0){
				bottomMid_Main.css("display","none");
			}else{
				bottomMid_Main.css("display","block");
			}
		});
		
		//联系部分
		var mid2 = 0;
		connect.click(function(){
			mid2++;
			if(mid2%2 == 0){
				connectMain.css('display','none');
			}else{
				connectMain.css('display','block');
				bottomMid_Main.css('display','none');
				country.css('display','none');
			}
		});
		
		//国家/地区
		deleteCountry.click(function(){
			countryMain.css("display","none");
		});
		var mid3 = 0;
		countryClick.click(function(){
			mid3++;
			if(mid3%2 == 0){
				countryMain.css('display','none');
			}else{
				countryMain.css('display','block');
				bottomMid_Main.css('display','none');
				connectMain.css('display','none');
			}
		});
	})();
	
	//固定导航栏
	(function(){
		var topMain=$('#nav').height();/*获取到Top的高度*/
        var menu=$('#menu');
        $(window).scroll(function(){
            if($(window).scrollTop()>topMain){
                menu.addClass('ScrollNav');
            }else{
                menu.removeClass('ScrollNav');
            }
        });
	})();
});
